from client import RedisClient

# 创建客户端实例
client = RedisClient()
client.connect()

print(client.get('key1'))
print(client.get('key2'))
print(client.get('key2'))
# 基本操作示例
client.set('key1', 'value1')
client.set('key2', 'value2', ex=60)  # 60秒后过期
print(client.get('key1'))
print(client.get('key2'))

# Hash操作示例
#client.hset('hash1', 'field1', 'value1')
#print(client.hget('hash1', 'field1'))

# 关闭连接
client.close()